package com.rapid.maintenance.ui.activity.productmall;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.core.util.Pair;

import com.google.android.material.tabs.TabLayout;
import com.rapid.maintenance.R;
import com.rapid.maintenance.base.BaseActivity;
import com.rapid.maintenance.ui.activity.productmall.dialog.AddShoppingCartDialog;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class ProductMallProductDetailActivity extends BaseActivity {
    @BindView(R.id.tab)
    TabLayout tab;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_price)
    TextView tvPrice;
    @BindView(R.id.old_price)
    TextView oldPrice;
    @BindView(R.id.company_icon)
    ImageView companyIcon;
    @BindView(R.id.company_name)
    TextView companyName;
    @BindView(R.id.company_desc)
    TextView companyDesc;
    @BindView(R.id.kefu)
    TextView kefu;
    @BindView(R.id.shangpu)
    TextView shangpu;
    @BindView(R.id.shoucang)
    TextView shoucang;
    @BindView(R.id.jiarugouwuche)
    TextView jiarugouwuche;
    @BindView(R.id.lijigoumai)
    TextView lijigoumai;
    AddShoppingCartDialog dialog;
    @BindView(R.id.shopping_bar)
    RelativeLayout shoppingBar;

    @Override
    protected int provideRootLayout() {
        return R.layout.activity_product_mall_product_detail;
    }

    @Override
    protected void init() {
        setTitle("产品详情");
        setStatusBarColor(0xFF016DB6);
        setToolBarColor(0xFF016DB6);
    }


    @OnClick({R.id.kefu, R.id.shangpu, R.id.shoucang, R.id.jiarugouwuche, R.id.lijigoumai, R.id.ll_evaluation})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_evaluation:
                startActivity(ProductMallAllEvaluationActivity.class, Pair.create(shoppingBar, "shopping_bar"), Pair.create(getToolbar(), "all_main_toolbar"), Pair.create(getStatusBar(), "status_bar"));
                break;
            case R.id.kefu:
                break;
            case R.id.shangpu:
                break;
            case R.id.shoucang:
                break;
            case R.id.jiarugouwuche:
                if (dialog == null)
                    dialog = new AddShoppingCartDialog(this);
                dialog.show();
                break;
            case R.id.lijigoumai:
                break;
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
